package cn.edu.zafu.bigdata.x.Foo;

class Book {
    // 字段
    private String title;
    private String author;
    private double price;

    // 带参构造器
    public Book(String title, String author, double price) {
        this.title = title;
        this.author = author;
        this.price = price;
    }

    // 重写toString()方法
    @Override
    public String toString() {
        return "Book[title=" + title + ", author=" + author + ", price=" + price + "]";
    }
}

public class TestBook {
    public static void main(String[] args) {
        // 创建Book对象
        Book book1 = new Book("Java Programming", "John Doe", 29.99);
        Book book2 = new Book("Learning Python", "Jane Smith", 19.99);
        Book book3 = new Book("HuTieSheng", "Alice Johnson", 39.99);

        // 打印Book对象的信息
        System.out.println(book1);
        System.out.println(book2);
        System.out.println(book3);
    }
}
